@class-prefix-index-bar: ~'adm-index-bar';

.@{class-prefix-index-bar} {
  --color: var(--adm-color-text);
  overflow: hidden;

  height: 100%;
  position: relative;
  background-color: var(--adm-color-white);
  --sticky-offset-top: 0;

  &-body {
    overflow: scroll;
    height: 100%;
    width: 100%;
    &::-webkit-scrollbar {
      display: none;
    }
  }

  &-anchor {
    &-title {
      display: flex;
      flex-direction: column;
      justify-content: center;
      height: 35px;
      padding: 0 12px;
      color: var(--adm-color-weak);
      font-size: var(--adm-font-size-main);
      background-color: var(--adm-color-box);
    }
  }

  &-sidebar {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 910;
    overflow: visible;
    color: var(--adm-color-weak);
    font-size: var(--adm-font-size-4);
    user-select: none;
    touch-action: none;

    &-bubble {
      position: absolute;
      top: 50%;
      right: 60px;
      width: 47px;
      height: 47px;
      color: var(--adm-color-white);
      font-size: 25px;
      line-height: 47px;
      text-align: center;
      background: var(--adm-color-light);
      border-radius: 50%;
      transform: translateY(-50%);
    }

    &-row {
      cursor: pointer;
      width: auto;
      text-align: right;
      position: relative;
      padding: 0 12px;
      > * {
        pointer-events: none;
      }
    }

    &-item {
      display: inline-flex;
      width: 16px;
      height: 16px;
      line-height: 16px;
      justify-content: center;
      align-items: center;
    }

    &-item-active {
      color: var(--adm-color-white);
      background-color: var(--adm-color-primary);
      border-radius: 50%;
    }

    &-interacting {
      width: 100%;
    }
  }

  &-sticky {
    .@{class-prefix-index-bar}-anchor-title {
      position: sticky;
      z-index: 900;
      top: var(--sticky-offset-top);
      left: 0;
    }
  }
}
